Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set aria-selected="false" on deselected items #76

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JanMiksovsky
Copy link

As @giltza noted in the original issue on paper-tabs, the aria-selected attribute should be set to "false" for deselected items, not removed.

This PR handles two situations: 1) ensures that all items start out with aria-selected="false" by default, 2) sets aria-selected="false" when a individual item is explicitly deselected.

I've tested this fix under the indicated Windows screen reader, NVDA, and confirmed that paper-tabs now works as expected:

  • When using the arrow keys to navigate horizontally among paper-tabs, the name of each tab is announced.
  • The screen reader will only announce that the tab is selected if the tab is actually selected. (Previously, the screen reader would announce that the tab was selected, even if it was not, because unselected tabs were missing the aria-selected attribute.)

Jan Miksovsky added 3 commits August 24, 2016 17:36
…or which become deselected (rather than removing the attribute).
…or which become deselected (rather than removing the attribute). Fixes PolymerElements#75.
*/
_resetTabindices: function() {
_resetItemAttributes: function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One underscore indicates protected for us (two indicates private). This technically constitutes a breaking API change. If we can verify it's not being overridden in elements we control that depend on this behavior, it's probably fine..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, the only references to _resetTabindices are in iron-menu-behavior.html itself. This also seems like an unusual function for someone to override.

If you'd prefer to play it safe, I could preserve the _resetTabindices name, by either: 1) using the old name for the new function (which does more than reset tab indices) or, 2) creating a new _resetItemAttributes that calls both the old _resetTabindicies and does the new work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants